function tableToExcel(jsonData, str, name) {
	for (var i = 0; i < jsonData.length; i++) {
		for (var item in jsonData[i]) {
			str += `${jsonData[i][item] + '\t'},`;
		}
		str += '\n';
	}
	var uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str);
	var link = document.createElement("a");
	link.href = uri;
	link.download = name + ".csv";
	document.body.appendChild(link);
	link.click();
	document.body.removeChild(link);
}

function getDay(day) {
	var today = new Date();
	var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
	today.setTime(targetday_milliseconds);
	var tYear = today.getFullYear();
	var tMonth = today.getMonth();
	var tDate = today.getDate();
	tMonth = doHandleMonth(tMonth + 1);
	tDate = doHandleMonth(tDate);
	return tYear + "-" + tMonth + "-" + tDate;
}

function doHandleMonth(month) {
	var m = month;
	if (month.toString().length == 1) {
		m = "0" + month;
	}
	return m;
}
var skcsvdata = [],
	fkcsvdata = [];
var data = {
	//雷区勿动
	usermas1: !0, //基本信息 ,初始化为!0，其余均为!1
	usermas2: !1, //客户信息
	usermas3: !1, //账户信息
	usermas4: !1, //产品信息
	usermas5: !1, //首款订单
	usermas6: !1, //付款订单
	usermas7: !1, //对账查询
	usermas8: !1, //改密
	usermas9: !1, //密钥
	usermas10: !1,
	month: "", //当前月份
	day: "", //当前星期
	getdate: "", //当前日
	hourMin: "",
	timeSystem: "", //12小时制
	titelfool1: !0,
	titelfool2: !1,
	titelfool3: !1,
	titelfool4: !1,
	titelfool5: !1,
	titelfool6: !1,
	titelfool7: !1,
	titelfool8: !1,
	listyle1: !1, //nav li状态
	listyle2: !1,
	listyle3: !1,
	listyle4: !1, //nav li状态
	listyle5: !1,
	listyle6: !1,
	listyle7: !1, //nav li状态
	listyle8: !1,
	navstyle: !0, //菜单状态
	codebutton: "获取短信验证码",
	wait: 60,
	codedisabled: !1, //cdoe状态
	postdisabled: !1,
	zwdata: true,
	past0: !1,
	past1: !1,
	past2: !1,
	past3: !1,
	pasleng: "",
	usertel: "",
	useremail: "",
	wlset: "",
	opsw: "",
	npsw: "",
	bgnpsw: "",
	dkeycode: "",
	wait2: 60,
	dkeycode2: "",
	codedisabled2: !1,
	codebutton2: "获取短信验证码",
	dkey: "",
	indexurl: "../member/getinfo.do",
	loginurl: "../member/doaction.do",
	scodeurl: "../member/sendsms.do",
	dkeyurl: "../member/safeinfo.do",
	ddcxurl: "",
	str: /\信息提示/g,
	onlogin: /\退出系统成功/g,
	signOut: /\您还没登录!/g,
	pasmod: /\原密码错误，无法修改/g,
	pasmod2: /\修改信息成功！/g,
	act: 'getinfo',
	act2: 'getdata',
	act3: 'EditSafeInfo',
	username: sessionStorage.getItem("userid"),
	EssInfoLastlandingtime: "", //首页信息
	EssInfoReservedinformation: "",
	EssInfoNameOfTheMerchant: "",
	EssInfoLoginAccount: "",
	EssInfoMerchantNumber: "",
	EssInfoLogonOperator: "",
	EssInfoAvailableBalance: "",
	EssInfoFreezingAmount: "",
	EssInfoUnsettledAmount: "",

	SubmissionROStartDate: "", //收款订单发送字段
	SubmissionROEndDate: "",
	SubmissionROMerchantOrderNum: "",
	SubmissionROBusinessProducts: "",
	SubmissionROPayMethod: "",
	SubmissionROOrderStatus: "",
	orddata: [],
	PayOSStartDate: "", //付款订单发送字段
	PayOSEndDate: "",
	PayOSMerchantOrderNum: "",
	PayOSBusinessProducts: "",
	PayOSPayMethod: "",
	PayOSOrderStatus: "",
	PayOSAccountsReceivableAccount: "",
	PayOSAccountsReceivableAccountName: "",
	PayOSWhetherReturn: "",
	ReconciliationDate: "", //对账查询发送字段
	BaseInfo: "", //基本信息
	kpxx: "", //开票信息
	lxInfo: "", //联系人信息
	jsInfo: "", //结算银行信息
	PayInfo: "", //付款银行
	cpInfo: [],
	ksczcp: [],
	kscxzpsel: "",
	getlists: [],
	getpage: [0, 1, 1],
	tzpage: "",
	flies: "",
	fliestext: "",
	bdif: false
};
var uu = new Vue({
	el: "#user",
	data: data,
	mounted() {
		if (sessionStorage.getItem("wait2")) {
			this.wait2 = Number(sessionStorage.getItem("wait2"));
			this.ciphertime2()
		}
	},
	methods: {
		gettime: function gettime() {
			var date = new Date();
			this.month = new Array("Jan", "Feb", "Mar", "Apr", "May ", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")[date.getMonth()];
			this.getdate = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
			this.day = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thurday ", "Friday", "Saturday")[date.getDay()];
			this.hour = date.getHours() > 12 ? date.getHours() - 12 : date.getHours();
			this.timeSystem = date.getHours() > 12 ? "PM" : "AM";
			this.hour = this.hour < 10 ? "0" + this.hour : this.hour;
			this.minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
			this.hourMin = this.hour + ":" + this.minute;
		},
		displayInformation: function displayInformation(a) {
			if (a === 2) {
				this.titelfool1 = !1;
				this.titelfool2 = !0;
				this.titelfool3 = !1;
				this.titelfool4 = !1;
				this.titelfool5 = !1;
				this.titelfool6 = !1;
				this.titelfool7 = !1;
				this.titelfool8 = !1, this.usermas1 = !1;
				this.usermas2 = !0;
				this.usermas3 = !1;
				this.usermas4 = !1;
				this.usermas5 = !1;
				this.usermas6 = !1;
				this.usermas7 = !1;
				this.usermas8 = !1;
				this.usermas9 = !1;
				this.usermas10 = !1;
			} else if (a === 3) {
				this.titelfool1 = !1;
				this.titelfool2 = !0;
				this.titelfool3 = !1;
				this.titelfool4 = !1;
				this.titelfool5 = !1;
				this.titelfool6 = !1;
				this.titelfool7 = !1;
				this.titelfool8 = !1, this.usermas1 = !1;
				this.usermas2 = !1;
				this.usermas3 = !0;
				this.usermas4 = !1;
				this.usermas5 = !1;
				this.usermas6 = !1;
				this.usermas7 = !1;
				this.usermas8 = !1;
				this.usermas9 = !1;
				this.usermas10 = !1;
			} else if (a === 4) {
				this.titelfool1 = !1;
				this.titelfool2 = !0;
				this.titelfool3 = !1;
				this.titelfool4 = !1;
				this.titelfool5 = !1;
				this.titelfool6 = !1;
				this.titelfool7 = !1;
				this.titelfool8 = !1, this.usermas1 = !1;
				this.usermas2 = !1;
				this.usermas3 = !1;
				this.usermas4 = !0;
				this.usermas5 = !1;
				this.usermas6 = !1;
				this.usermas7 = !1;
				this.usermas8 = !1;
				this.usermas9 = !1;
				this.usermas10 = !1;
			} else if (a === 5) {
				this.titelfool1 = !1;
				this.titelfool2 = !1;
				this.titelfool3 = !0;
				this.titelfool4 = !1;
				this.titelfool5 = !1;
				this.titelfool6 = !1;
				this.titelfool7 = !1;
				this.titelfool8 = !1, this.usermas1 = !1;
				this.usermas2 = !1;
				this.usermas3 = !1;
				this.usermas4 = !1;
				this.usermas5 = !0;
				this.usermas6 = !1;
				this.usermas7 = !1;
				this.usermas8 = !1;
				this.usermas9 = !1;
				this.usermas10 = !1;
			} else if (a === 6) {
				this.titelfool1 = !1;
				this.titelfool2 = !1;
				this.titelfool3 = !1;
				this.titelfool4 = !0;
				this.titelfool5 = !1;
				this.titelfool6 = !1;
				this.titelfool7 = !1;
				this.titelfool8 = !1, this.usermas1 = !1;
				this.usermas2 = !1;
				this.usermas3 = !1;
				this.usermas4 = !1;
				this.usermas5 = !1;
				this.usermas6 = !0;
				this.usermas7 = !1;
				this.usermas8 = !1;
				this.usermas9 = !1;
				this.usermas10 = !1;
			} else if (a === 7) {
				this.titelfool1 = !1;
				this.titelfool2 = !1;
				this.titelfool3 = !1;
				this.titelfool4 = !1;
				this.titelfool5 = !1;
				this.titelfool6 = !0;
				this.titelfool7 = !1;
				this.titelfool8 = !1, this.usermas1 = !1;
				this.usermas2 = !1;
				this.usermas3 = !1;
				this.usermas4 = !1;
				this.usermas5 = !1;
				this.usermas6 = !1;
				this.usermas7 = !0;
				this.usermas8 = !1;
				this.usermas9 = !1;
				this.usermas10 = !1;
			} else if (a === 8) {
				this.titelfool1 = !1;
				this.titelfool2 = !1;
				this.titelfool3 = !1;
				this.titelfool4 = !1;
				this.titelfool5 = !0;
				this.titelfool6 = !1;
				this.titelfool7 = !1;
				this.titelfool8 = !1, this.usermas1 = !1;
				this.usermas2 = !1;
				this.usermas3 = !1;
				this.usermas4 = !1;
				this.usermas5 = !1;
				this.usermas6 = !1;
				this.usermas7 = !1;
				this.usermas8 = !0;
				this.usermas9 = !1;
				this.usermas10 = !1;
			} else if (a === 9) {
				this.titelfool1 = !1;
				this.titelfool2 = !1;
				this.titelfool3 = !1;
				this.titelfool4 = !1;
				this.titelfool5 = !1;
				this.titelfool6 = !1;
				this.titelfool7 = !0;
				this.titelfool8 = !1, this.usermas1 = !1;
				this.usermas2 = !1;
				this.usermas3 = !1;
				this.usermas4 = !1;
				this.usermas5 = !1;
				this.usermas6 = !1;
				this.usermas7 = !1;
				this.usermas8 = !1;
				this.usermas9 = !0;
				this.usermas10 = !1;
			} else if (a === 10) {
				this.titelfool1 = !1;
				this.titelfool2 = !1;
				this.titelfool3 = !1;
				this.titelfool4 = !1;
				this.titelfool5 = !1;
				this.titelfool6 = !1;
				this.titelfool7 = !1;
				this.titelfool8 = !0, this.usermas1 = !1;
				this.usermas2 = !1;
				this.usermas3 = !1;
				this.usermas4 = !1;
				this.usermas5 = !1;
				this.usermas6 = !1;
				this.usermas7 = !1;
				this.usermas8 = !1;
				this.usermas9 = !1;
				this.usermas10 = !0;
			} else {
				this.titelfool1 = !0;
				this.titelfool2 = !1;
				this.titelfool3 = !1;
				this.titelfool4 = !1;
				this.titelfool5 = !1;
				this.titelfool6 = !1;
				this.titelfool7 = !1;
				this.titelfool8 = !1, this.usermas1 = !0;
				this.usermas2 = !1;
				this.usermas3 = !1;
				this.usermas4 = !1;
				this.usermas5 = !1;
				this.usermas6 = !1;
				this.usermas7 = !1;
				this.usermas8 = !1;
				this.usermas9 = !1;
				this.usermas10 = !1;
			}
		},
		cipherCode2: function cipherCode2() {
			var _this = this;
			this.$http.post(this.scodeurl, {
				enews: "SafeKey",
				MerchantId: this.EssInfoMerchantNumber
			}, {
				emulateJSON: true
			}).then(function (result) {
				_this.loginor(result.body);
				if (result.body.msg_code === "0000") {
					tc(result.body.msg);
					_this.ciphertime2();
				} else {
					var t = "错误代码：" + result.body.msg_code + "," + result.body.msg;
					al(t)
				}
			});
		},
		ciphertime2: function ciphertime2() {
			if (this.wait2 == 0) {
				this.codebutton2 = "获取短信验证码";
				this.codedisabled2 = !1;
				this.wait2 = 60;
			} else {
				this.wait2--;
				sessionStorage.setItem("wait2", this.wait2)
				this.codedisabled2 = !0;
				this.codebutton2 = "重新发送(" + this.wait2 + ")";
				setTimeout("uu.ciphertime2()", 1000);
			}
		},
		whiteListSetting: function whiteListSetting() {
			var _this2 = this;

			var sip = this.wlset;
			this.wlset = this.wlset.replace(/\s/g, ",");
			var wls = this.wlset.split(",");
			var flag = wls.length;
			if (wls.length < 6) {
				for (var i = 0; i < wls.length; i++) {
					var reg = /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$/;
					var o = wls[i];
					if (!reg.test(wls[i])) {
						this.wlset = sip;
						flag--;
						tc("IP格式错误，请检查");
						break;
					} else {
						this.wlset = sip;
					}
				}
				if (flag === wls.length) {
					this.$http.post(this.dkeyurl, {
						enews: "SafeIP",
						ipv4: this.wlset,
						sms: this.useremail
					}, {
						emulateJSON: true
					}).then(function (result) {
						_this2.loginor(result.body);
						if (result.body.msg_code === "0000") {
							tc(result.body.msg);
						} else {
							var t = "错误代码：" + result.body.msg_code + "," + result.body.msg;
							al(t)
						}
					});
				}
			} else {
				this.wlset = sip;
				tc("IP白名单最多添加5个");
			}
		},
		submissionRO: function submissionRO(a) {
			//重置
			this.PayOSStartDate = "";
			this.PayOSEndDate = "";
			this.PayOSMerchantOrderNum = "";
			this.PayOSBusinessProducts = "";
			this.PayOSPayMethod = "";
			this.PayOSOrderStatus = "";
			this.PayOSAccountsReceivableAccount = "";
			this.PayOSAccountsReceivableAccountName = "";
			this.PayOSWhetherReturn = "";
		},
		indexinfo: function indexinfo() {
			var _this3 = this;

			// var flag = !sessionStorage.getItem("userid") && !document.cookie;
			// if (false) {
			// 	window.location.href = "login.html";
			// } else {
			this.$http.get(this.indexurl, {
				params: {
					act: this.act
				}
			}).then(function (result) {
				_this3.loginor(result.body);
				var data = result.body;
				_this3.EssInfoLastlandingtime = data.LastendTime;
				_this3.EssInfoMerchantNumber = data.MerchantId;
				_this3.EssInfoReservedinformation = data.ReservInfo;
				_this3.EssInfoAvailableBalance = data.Money;
				_this3.useremail = data.email;
				_this3.usertel = data.Phone;
				_this3.wlset = data.SafeIP;
				_this3.EssInfoFreezingAmount = data.Money_dj;
				_this3.EssInfoUnsettledAmount = data.Money_wjs;
				_this3.BaseInfo = data.BaseInfo === "" ? "" : JSON.parse(data.BaseInfo);
				_this3.kpxx = data.kpxx === "" ? "" : JSON.parse(data.kpxx);
				_this3.lxInfo = data.lxInfo === "" ? "" : JSON.parse(data.lxInfo);
				_this3.jsInfo = data.jsInfo === "" ? "" : JSON.parse(data.jsInfo);
				_this3.PayInfo = data.PayInfo === "" ? "" : JSON.parse(data.PayInfo);
				_this3.cpInfo = data.cpInfo === "" ? "" : JSON.parse(data.cpInfo);
				var st = /^9\d{3}/;
				_this3.ksczcp = [];
				for (var i = 0; i < _this3.cpInfo.length; i++) {
					if (_this3.cpInfo[i].PrFeeType === "0") _this3.cpInfo[i].PrFeeType = "%";
					if (_this3.cpInfo[i].PrFeeType === "1") _this3.cpInfo[i].PrFeeType = "元/笔";
					if (st.test(_this3.cpInfo[i].PrId)) {
						_this3.ksczcp.push(_this3.cpInfo[i])
					}
				}
				_this3.kscxzpsel = _this3.ksczcp[0].PrId;

			});
			// }
		},
		signout: function signout() {
			var _this4 = this;
			con()
		},
		loginor: function loginor(a) {
			var fl = !a.msg_code ? false : a.msg_code === "0011" ? true : false;
			if (fl) {
				sessionStorage.removeItem("userid");
				(function delAllCookie() {
					var myDate = new Date();
					myDate.setTime(-10000);
					var data = document.cookie;
					var dataArray = data.split("; ");
					for (var i = 0; i < dataArray.length; i++) {
						var varName = dataArray[i].split("=");
						document.cookie = varName[0] + "=''; expires=" + myDate.toGMTString();
					}
				})();
				window.location.href = "login.html";
			}
		},
		paswordleng: function paswordleng() {
			var modes = 0;
			var val = this.npsw;
			if (val.length < 6) {
				modes = 0;
			} else {
				if (/\d/.test(val)) modes++;
				if (/[a-z]/.test(val)) modes++;
				if (/[A-Z]/.test(val)) modes++;
				if (/\W/.test(val)) modes++;
			}
			if (modes === 0) {
				this.past0 = false;
				this.past1 = false;
				this.past2 = false;
				this.past3 = false;
			} else if (modes === 1) {
				this.past0 = true;
				this.past1 = false;
				this.past2 = false;
				this.past3 = false;
			} else if (modes === 2) {
				this.past0 = true;
				this.past1 = true;
				this.past2 = false;
				this.past3 = false;
			} else if (modes === 3) {
				this.past0 = true;
				this.past1 = true;
				this.past2 = true;
				this.past3 = false;
			} else {
				this.past0 = true;
				this.past1 = true;
				this.past2 = true;
				this.past3 = true;
			}
			this.pasleng = modes;
		},
		modpass: function modpass() {
			var _this5 = this;

			this.paswordleng();
			if (this.opsw !== "") {
				if (this.pasleng < 3) {
					tc("6-16位新密码不能为空且必须包含数字、字母及特殊字符");
				} else {
					if (this.npsw === this.bgnpsw) {
						this.$http.post(this.loginurl, {
							enews: this.act3,
							oldpassword: this.opsw,
							password: this.bgnpsw,
							repassword: this.bgnpsw,
							email: this.useremail
						}, {
							emulateJSON: true
						}).then(function (result) {
							if (result.body.msg_code !== "0000") {
								tc(result.body.msg);
							} else {
								als("修改成功,请重新登录",sessionStorage.removeItem("userid"))
							}
						});
					} else {
						tc("两次密码不一致");
					}
				}
			} else {
				tc("原密码不能为空");
			}
		},
		resdkey: function resdkey() {
			var _this6 = this;

			if (this.dkeycode) {
				this.$http.post(this.dkeyurl, {
					enews: "getKey",
					dkey: this.dkeycode
				}, {
					emulateJSON: true
				}).then(function (result) {
					_this6.loginor(result.body);
					if (result.body.msg_code === "0000") {
						_this6.dkey = result.body.value;
					} else {
						var t = "错误代码：" + result.body.msg_code + "," + result.body.msg;
						al(t)
					}
				});
			} else {
				tc("请填写验证码");
			}
		},
		restdkey: function restdkey() {
			var _this7 = this;

			if (this.dkey) {
				this.$http.post(this.dkeyurl, {
					enews: "SafeKey",
					MerchantId: this.EssInfoMerchantNumber,
					dkey: this.dkeycode
				}, {
					emulateJSON: true
				}).then(function (result) {
					_this7.loginor(result.body);
					if (result.body.msg_code === "0000") {
						_this7.dkey = result.body.value;
					} else {
						var t = "错误代码：" + result.body.msg_code + "," + result.body.msg;
						al(t)
					}
				});
			} else {
				tc("密钥为空，不可重置，请先显示密钥");
			}
		},
		autologin: function autologin() {
			var maxTime = 60 * 15; // seconds   
			var time = maxTime;
			var dombody = document.getElementById('bod');
			dombody.onkeydown = function (e) {
				time = maxTime;
			};
			dombody.onmousemove = function (e) {
				time = maxTime;
			};
			var intervalId = setInterval(function () {
				time--;
				if (time <= 0) {
					sessionStorage.removeItem("userid");
					(function delAllCookie() {
						var myDate = new Date();
						myDate.setTime(-10000);
						var data = document.cookie;
						var dataArray = data.split("; ");
						for (var i = 0; i < dataArray.length; i++) {
							var varName = dataArray[i].split("=");
							document.cookie = varName[0] + "=''; expires=" + myDate.toGMTString();
						}
					})();
					als("15分钟内未操作，系统已退出",clearInterval(intervalId))
				}
			}, 1000);
		},
		getfile: function getfile($event) {
			var event = window.event || $event;
			this.flies = event.target.files[0];
		},
		postupfile: function postupfile() {
			var _this8 = this;
			if (this.dkeycode2 !== "") {
				var da = new FormData();
				da.append("myfile", this.flies);
				da.append("PrId", this.kscxzpsel);
				da.append("dkey", this.dkeycode2);
				this.$http.post("../member/outm.do", da, {
					emulateJSON: true
				}).then(function (result) {
					this.dkeycode2=""
					var myDate = new Date();
					var date = myDate.toLocaleDateString();
					var hours = myDate.getHours() > 9 ? myDate.getHours() : '0' + myDate.getHours();
					var minutes = myDate.getMinutes() > 9 ? myDate.getMinutes() : '0' + myDate.getMinutes();
					var seconds = myDate.getSeconds() > 9 ? myDate.getSeconds() : '0' + myDate.getSeconds();
					var gettime = date + " " + hours + ":" + minutes + ":" + seconds;
					var sr = /\is not readable/g;
					if (sr.test(result.body)) {
						if (_this8.fliestext === "") {
							_this8.fliestext = '<div style="width:150px;float:left;color:#f00;">' + gettime + '</div><div style="float:left;width:84%;box-sizing: border-box;color:#f00;">解析失败，请检查文件类型</div>';
						} else {
							_this8.fliestext = '<div style="width:150px;float:left;color:#f00;">' + gettime + '</div><div style="float:left;width:84%;box-sizing: border-box;color:#f00;">解析失败，请检查文件类型</div><br>' + _this8.fliestext;
						}
					} else {
						if (result.body.msg_code === "0000") {
							if (_this8.fliestext === "") {
								_this8.fliestext = '<div style="width:150px;float:left;">' + gettime + '</div><div style="float:left;width:84%;box-sizing: border-box;">' + result.body.msg + '</div>';
							} else {
								_this8.fliestext = '<div style="width:150px;float:left;">' + gettime + '</div><div style="float:left;width:84%;box-sizing: border-box;">' + result.body.msg + '</div><br>' + _this8.fliestext;
							}
							_this8.flies = "";
							document.getElementById("files").value = "";
						} else {
							if (_this8.fliestext === "") {
								_this8.fliestext = '<div style="width:150px;float:left;color:#f00;">' + gettime + '</div><div style="float:left;width:84%;box-sizing: border-box;color:#f00;">错误代码：' + result.body.msg_code + '，' + result.body.msg + '</>';
							} else {
								_this8.fliestext = '<div style="width:150px;float:left;color:#f00;">' + gettime + '</div><div style="float:left;width:84%;box-sizing: border-box;color:#f00;">错误代码：' + result.body.msg_code + '，' + result.body.msg + '</div><br>' + _this8.fliestext;
							}
						}
					}
				});
			} else {
				tc("验证码为空")
			}

		},
		bdfun: function bdfun(a) {
			var _this9 = this;

			this.$http.post("../member/reOrder.do", {
				merc_order_no: a
			}, {
				emulateJSON: true
			}).then(function (result) {
				_this9.loginor(result.body);
				if (result.body.msg_code === "0000") {
					tc("补单成功");
				} else {
					var t = "错误代码：" + result.body.msg_code + "," + result.body.msg;
					al(t)
				};
				_this9.bdif = false;
			});
		}
	}
});
uu.indexinfo();
uu.gettime();
uu.autologin();
setInterval('uu.gettime()', 1000);

var tc = "",
	al = "",
	als = "",
	con = "";

layui.use(['element', 'form', 'layedit', 'laydate', 'table'], function () {
	var element = layui.element,
		form = layui.form,
		layer = layui.layer,
		layedit = layui.layedit,
		table = layui.table,
		$ = layui.jquery,
		laydate = layui.laydate;
$("#mouse1").mouseover(function () { 
	layer.tips('<span style="color:#4f4f4f">一小时内最多发送5条，验证码有效期为10分钟，有效期内可重复使用</span>', '#mouse',{
		tips:[2,"#ddd"],
		time: 5000
	});
});
$("#mouse2").mouseover(function () { 
	layer.tips('<span style="color:#4f4f4f">一小时内最多发送5条，验证码有效期为10分钟，有效期内可重复使用</span>', '#mouse',{
		tips:[2,"#ddd"],
		time: 5000
	});
});
$("#mouse3").mouseover(function () { 
	layer.tips('<span style="color:#4f4f4f">一小时内最多发送5条，验证码有效期为10分钟，有效期内可重复使用</span>', '#mouse4',{
		tips:[2,"#ddd"],
		time: 5000
	});
});
		

	// 监听导航点击
	element.on('nav(demo)', function (elem) {});
	//日期
	laydate.render({
		elem: '#date',
		range: true,
		max: 0
	});
	laydate.render({
		elem: '#date1',
		range: true,
		max: 0
	});
	laydate.render({
		elem: '#dzdate'
	});
	//加载产品列表
	(function cp() {
		var cpsel = '<option value="" selected=""></option>';
		for (var i = 0; i < uu.cpInfo.length; i++) {
			cpsel += '<option value="' + uu.cpInfo[i].PrId + '">' + uu.cpInfo[i].PrName + '</option>';
		}
		document.getElementById("cpsel").innerHTML = cpsel;
	})();
	// (function cp1() {
	// 	var cpsel = '<option value="" selected=""></option>';
	// 	for (var i = 0; i < uu.cpInfo.length; i++) {
	// 		cpsel += '<option value="' + uu.cpInfo[i].PrId + '">' + uu.cpInfo[i].PrName + '</option>';
	// 	}
	// 	document.getElementById("fkcpsel").innerHTML = cpsel;
	// })()
	form.render();
	//弹层
	tc = function tc(a) {
		layer.msg(a, {
			offset: '130px',
			anim: 6
		});
	};
	al = function al(t) {
		layer.alert(t, {
			skin: 'layui-layer-molv' //样式类名
				,
			closeBtn: 0
		})
	};
	als=function(t,d){
		layer.alert(t, {
			skin: 'layui-layer-molv' //样式类名
				,
			closeBtn: 0
		},function(){
			window.location.href = "login.html";
			d
		})
	};
	con = function (fn) {
		layer.confirm("确认要退出吗？", {
			btn: ['确定', '取消'] //按钮
		}, function () {
			$.ajax({
				url: '../member/doaction.do?enews=exit'
			}).success(function (data) {
				if (JSON.parse(data).msg_code === "0000") {
					sessionStorage.removeItem("userid");
					(function delAllCookie() {
						var myDate = new Date();
						myDate.setTime(-10000);
						var data = document.cookie;
						var dataArray = data.split("; ");
						for (var i = 0; i < dataArray.length; i++) {
							var varName = dataArray[i].split("=");
							document.cookie = varName[0] + "=''; expires=" + myDate.toGMTString();
						}
					})();
					window.location.href = "login.html";
				}
			})
		}, function () {});
	}
	//收款提交
	form.on('submit(demo1)', function (data) {
		var d, z;
		if (data.field.date === "" && data.field.merc_order_no === "" && data.field.sys_order_no === "") {
			tc("请填写查询日期或订单、商户号");
		} else {
			$.ajax({
				url: '../member/getinfo.do?act=getdatain',
				type: 'POST',
				data: JSON.stringify(data.field)
			}).success(function (data) {
				d = JSON.parse(data);
				if (d.msg_code !== "0000") {
					if (d.msg_code !== "0011") {
						tc(d.msg)
					} else {
						uu.loginor(d)
					}
				} else {
					var a = d.data;
					skcsvdata = [];
					for (var i = 0; i < a.length > 0 ? a.length : 0; i++) {
						var dd = [];
						dd = [a[i].merc_order_no, a[i].sys_order_no, a[i].order_time, a[i].pay_time, a[i].pr, a[i].PayType, a[i].money, a[i].money_js, a[i].money_sxf, a[i].isgood, a[i].ext];
						skcsvdata.push(dd);
					};
					table.render({
						elem: '#demo',
						data: a,
						cols: [
							[{
								field: 'merc_order_no',
								title: '商户订单号',
								width: '15%'
							}, {
								field: 'sys_order_no',
								title: '平台订单号',
								width: '252'
							}, {
								field: 'order_time',
								title: '订单创建时间',
								width: '13.5%'
							}, {
								field: 'pay_time',
								title: '订单完成时间',
								width: '13.5%'
							}, {
								field: 'pr',
								title: '业务产品',
								width: '100'
							}, {
								field: 'money',
								title: '交易金额',
								width: '100'
							}, {
								field: 'money_js',
								title: '结算金额',
								width: '100'
							}, {
								field: 'money_sxf',
								title: '手续费',
								width: '5%'
							}, {
								field: 'isgood',
								title: '订单状态',
								width: '100'
							}, {
								field: 'ext',
								title: '备注',
							}, {
								field: '',
								title: '操作',
								toolbar: '#barDemo',
								width: '83',
								fixed: 'right'
							}]
						],
						even: true,
						page: true,
						limits: [20, 30, 50, 100, 500],
						limit: 20
					});
				}
			});
		}
	});

	// 收款订单查询
	table.render({
		elem: '#demo',
		cols: [
			[{
				field: 'merc_order_no',
				title: '商户订单号',
				width: '15%'
			}, {
				field: 'sys_order_no',
				title: '平台订单号',
				width: '252'
			}, {
				field: 'order_time',
				title: '订单创建时间',
				width: '13.5%'
			}, {
				field: 'pay_time',
				title: '订单完成时间',
				width: '13.5%'
			}, {
				field: 'pr',
				title: '业务产品',
				width: '5%'
			}, {
				field: 'money',
				title: '交易金额',
				width: '5%'
			}, {
				field: 'money_js',
				title: '结算金额',
				width: '5%'
			}, {
				field: 'money_sxf',
				title: '手续费',
				width: '5%'
			}, {
				field: 'isgood',
				title: '订单状态',
				width: '92'
			}, {
				field: 'ext',
				title: '备注',
				width: '92'
			}, {
				field: '',
				title: '操作',
				toolbar: '#barDemo',
				width: '5%',
				fixed: 'right'
			}]
		],
		data: []
	});
	//付款提交
	form.on('submit(fk)', function (data) {
		var d, z;
		if (data.field.date === "" && data.field.merc_order_no === "") {
			tc("请填写查询日期或订单号");
		} else {
			$.ajax({
				url: '../member/getinfo.do?act=getdataout',
				type: 'POST',
				data: JSON.stringify(data.field)
			}).success(function (data) {
				d = JSON.parse(data);
				if (d.msg_code !== "0000") {
					if (d.msg_code !== "0011") {
						tc(d.msg)
					} else {
						uu.loginor(d)
					}
				} else {
					var a = d.data;
					fkcsvdata = [];
					for (var i = 0; i < a.length > 0 ? a.length : 0; i++) {
						var dd = [];
						dd = [a[i].merc_order_no, a[i].sys_order_no, a[i].order_time, a[i].pay_time, a[i].pr, a[i].PayType, a[i].money, a[i].money_sxf, a[i].isgood, a[i].ext];
						fkcsvdata.push(dd);
					};
					table.render({
						elem: '#fk',
						data: a,
						cols: [
							[{
								field: 'merc_order_no',
								title: '商户订单号',
								width: '15%'
							}, {
								field: 'sys_order_no',
								title: '平台订单号',
								width: '252'
							}, {
								field: 'order_time',
								title: '订单创建时间',
								width: '13.5%'
							}, {
								field: 'pay_time',
								title: '订单完成时间',
								width: '13.5%'
							}, {
								field: 'pr',
								title: '业务产品',
								width: '100'
							}, {
								field: 'money',
								title: '金额',
								width: '135'
							}, {
								field: 'money_sxf',
								title: '手续费',
								width: '126'
							}, {
								field: 'isgood',
								title: '订单状态',
								width: '128'
							}, {
								field: 'ext',
								title: '备注',
							}, ]
						],
						even: true,
						page: true,
						limits: [10, 20, 30, 50, 100],
						limit: 20
					});
				}
			});
		}
	});
	//付款订单
	table.render({
		elem: '#fk',
		cols: [
			[{
					field: 'merc_order_no',
					title: '商户订单号',
					width: '15%'
				}, {
					field: 'sys_order_no',
					title: '平台订单号',
					width: '252'
				}, {
					field: 'order_time',
					title: '订单创建时间',
					width: '13.5%'
				}, {
					field: 'pay_time',
					title: '订单完成时间',
					width: '13.5%'
				}, {
					field: 'pr',
					title: '业务产品',
					width: '99'
				}, {
					field: 'money',
					title: '金额',
					width: '7.5%'
				}, {
					field: 'money_sxf',
					title: '手续费',
					width: '7.5%'
				},
				{
					field: 'isgood',
					title: '订单状态',
					width: '92'
				}, {
					field: 'ext',
					title: '备注',
				}
			]
		],
		data: []

	});
	//对账提交
	form.on('submit(dz)', function (data) {
		tc("暂未开通");
		return false;
		// console.log(data.field)
		// if (data.field.date === "" ) {
		//     tc("请填写查询日期或订单号")
		// } else {
		//     var d = uu.moPostlist("../member/getinfo.do", JSON.stringify(data.field));
		//     uu.loginor(data);
		//     if (d.code !== "0000") {
		//         d.data = [];
		//     } else {
		//         d.data = d.data;
		//     }
		//     table.render({
		//         elem: '#dz',
		//         data: d.data,
		//         cols: [
		//             [{
		//                 field: 'merc_order_no',
		//                 title: '对账日期'
		//             }, {
		//                 field: 'sys_order_no',
		//                 title: '类型'
		//             }, {
		//                 field: 'order_time',
		//                 title: '操作'
		//             }]
		//         ],
		//         even: true,
		//         page: true,
		//         limits: [10, 20, 30, 50, 100],
		//         limit: 20
		//     })};
	});
	//对账查询
	table.render({
		elem: '#dz',
		cols: [
			[{
				field: 'merc_order_no',
				title: '对账日期'
			}, {
				field: 'sys_order_no',
				title: '类型'
			}, {
				field: 'order_time',
				title: '操作'
			}]
		],
		data: []
	});

	table.on('tool(demo)', function (obj) {
		var data = obj.data;
		if (uu.bdif) {
			tc("补单操作中，请勿重复点击");
		} else {
			uu.bdif = true;
			uu.bdfun(data.merc_order_no);
		}
	});
});



function downcsv(t) {
	var a, b, c;
	a = [];
	if (t === "skdd") {
		a = skcsvdata;
		b = "商户订单号,平台订单号,订单创建时间,订单完成时间,业务产品,支付方式,交易金额,结算金额,手续费,订单状态,备注\n";
		c = "收单查询" + getDay(0);
		if (a.length > 0) {
			tableToExcel(a, b, c)
		} else {
			tc("无导出数据,请先查询数据")
		}
	} else {
		a = fkcsvdata;
		b = "商户订单号,平台订单号,订单创建时间,订单完成时间,业务产品,支付方式,金额,手续费,订单状态,备注\n";
		c = "代付查询" + getDay(0);
		if (a.length > 0) {
			tableToExcel(a, b, c)
		} else {
			tc("无导出数据,请先查询数据")
		}
	}
}